<%--
  Created by IntelliJ IDEA.
  User: MTA
  Date: 2021/3/6
  Time: 10:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"  import="java.util.*,com.jt.pojo.*" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    List<User> list = new ArrayList<User>();
    list.add(new User(1,"tom",18,"男"));
    list.add(new User(2,"lucy",19,"女"));
    list.add(new User(3,"jerry",29,"男"));
//    List<User> list = (List<User>)request.getAttribute("stuList");
%>

<table border="1px" width="65%" align="center">
    <tr>
        <td colspan="4" align="center"><h3>学生信息</h3></td>
    </tr>
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>性别</th>
    </tr>
 <%
     for(int i=0;i<list.size();i++){
         User u = list.get(i);
 %>
    <tr>
        <td><%=u.getId()%></td>
        <td><%=u.getName()%></td>
        <td><%=u.getAge()%></td>
        <td><%=u.getSex()%></td>
    </tr>
    <%
        }
    %>

</table>

</body>
</html>
